//----------------------------------------------------------
    // 自定义落地模块进行测试
//----------------------------------------------------------

#include "../src/ymbxlog.hpp"
#include "rollbytimsizeSink.hpp"

using namespace ymbxlog;


void test_log(const std::string& name)
{
    rinfo("测试开始");
    Logger::ptr slp = GetLogger(name);
    if (slp.get() == nullptr)
    {
        std::cout << "不存在" << std::endl;
        exit(0);
    }
    int cnt=1000;
    while(cnt--){
        slp->debug( 1,"DEBUG");
        slp->info( 2,"INFO");
        slp->warn(3, "WARNING");
        slp->error( 4,"ERROR");
        slp->fatal( 5,"FATAL");
        sleep(1);
    }
    
    rinfo("测试结束");
}
int main()
{
    std::unique_ptr<LoggerBuilder> uplb(new GlobalLoggerBuild());
    uplb->BuildLoggername("synclogger");
    uplb->BuildLimitLevel(LogLevel::Level::INFO);
    uplb->EnableLoggerSync();
    uplb->BuildFormatter();
    uplb->BuildSink<extendlog::RollByTimeSizeSink>("./log/rollbtss/rollby");
    uplb->Build();
    test_log("synclogger");

    return 0;
}